package com.fulihui.common.result.rpc;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;

/**
 * RPC基础返回封装
 *
 * @author: Levon
 * @version: v 0.1 2018-06-14 14:46
 */
@Getter
@Setter
@ToString
public class BaseResult implements Serializable {

    private static final long serialVersionUID = 7282624014134000164L;

    public static final int SUCCESS = 0;
    public static final String SUCC_MSG = "ok";

    /**
     * 错误代码，初始化-1标示没有被赋值过，0为成功
     **/
    protected int errcode = -1;
    /**
     * 错误描述
     **/
    protected String errmsg = "";

    public boolean isSuccess() {
        return errcode == SUCCESS;
    }
}
